<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>

  <style lang="css">
    body * {
      margin: 0;
      padding: 0;
    }

    .xuanzekuang {
      width: 400px;
      height: 120px;
      margin: 10px auto;
      box-sizing: border-box;
      background-color: #cccccc;
    }

    .xuanzekuang input[type='radio'] {
      margin-left: 2px;
      margin-right: 2px;
      display: none;
    }

    .xuanzekuang input[type='radio']+label:before {
      content: '';
      display: inline-block;
      width: 10px;
      height: 10px;
      margin-right: 5px;
      border-radius: 100%;
      vertical-align: middle;
      border: 2px solid #E4E4E4;
      background: #F9F9F9;
    }

    .xuanzekuang input[type='radio']:checked+label:before {
      background: #777777;
    }

    .xuanzekuang input[type='checkbox'] {
      display: none;
    }

    .xuanzekuang input[type='checkbox']+label:before {
      content: '';
      width: 10px;
      height: 10px;
      vertical-align: middle;
      margin-right: 5px;
      display: inline-block;
      background: #F9F9F9;
      border: 2px solid #CCCCCC;
    }

    .xuanzekuang input[type='checkbox']:checked+label:before {
      background: lightcoral;
    }
  </style>
</head>

<body>
  <div class="xuanzekuang">
    <h1>自定义单选框</h1>
    <input type="radio" name="pay" id="p_yes" class="rdo" />
    <label for="p_yes">是</label>
    <input type="radio" name="pay" id="p_no" class="rdo" />
    <label for="p_no">否</label>
  </div>
  <div class="xuanzekuang">
    <h1>自定义选择框</h1>
    <input type="checkbox" name="fav" id="book" class="rdo" />
    <label for="book">Book</label>
    <input type="checkbox" name="fav" id="run" class="rdo" />
    <label for="run">Run</label>
    <input type="checkbox" name="fav" id="music" class="rdo" />
    <label for="music">Music</label>
    <input type="checkbox" name="fav" id="ktv" class="rdo" />
    <label for="ktv">KTV</label>
    <input type="checkbox" name="fav" id="swimming" class="rdo" />
    <label for="swimming">swimming</label>
  </div>
</body>

</html>